﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace SnmpForm
{
    public partial class LoginForm : Form
    {
        public LoginForm()
        {
            InitializeComponent();
        }

        private void buttonLogin_Click(object sender, EventArgs e)
        {
            if (textBoxUsername.Text.Length > 0)
            {
                if (textBoxPassword.Text.Length > 0)
                {
                    this.DialogResult = System.Windows.Forms.DialogResult.OK;
                    this.Close();
                }
                else
                {
                    labelErrorInfo.Text = "密码不可以为空";
                }
            }
            else
            {
                labelErrorInfo.Text="用户名不可以为空";
            }
        }

        private void button2_Click(object sender, EventArgs e)
        {
            this.DialogResult = System.Windows.Forms.DialogResult.Cancel;
            this.Close();
        }

        public string GetUsername()
        {
            return textBoxUsername.Text;
        }

        public string GetPassword()
        {
            return textBoxPassword.Text;
        }

        private void LoginForm_Load(object sender, EventArgs e)
        {

        }
    }
}
